package test;

import org.springframework.context.support.GenericXmlApplicationContext;

import test.domain.User;
import test.repository.UserRepository;

public class Main {
    public static void main(String[] args) {
        GenericXmlApplicationContext ctx = new GenericXmlApplicationContext("application-context.xml");

        try {
            UserRepository userRepository = ctx.getBean(UserRepository.class);

            for (User user : userRepository.findBySalary_GreaterThanAndPosition_OrderBySalary_Desc(1050, "developer")) {
                System.out.println(user.getSalary());
            }
        } finally {
            ctx.close();
        }
    }
}
